package com.h.forum.dao;

import com.h.forum.pojo.model.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MessageMapper {
    int insert(Message record);

    int insertSelective(Message record);

    Message selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Message record);

    int updateByPrimaryKey(Message record);

    /**
     * 根据用户Id，查询未读数
     * @param receiveUserId
     * @return
     */
    Integer selectUnreadCount(@Param("receiveUserId") Long receiveUserId);

    List<Message> selectByReceiveUserId(@Param("receiveUserId") Long receiveUserId);
}